package com.ruoyi.quartz.task;

import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @version 1.0
 * @program: Chikura-Java
 * @className MyTask
 * @description:
 * @author: Administrator
 * @create: 2025-08-05 15:22
 **/

@Component
public class MyTask
{
    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    LocalDateTime now = LocalDateTime.now();
    public void showTime()
    {
        String formattedTime = now.format(formatter);
        System.out.println("执行定时任务，当前时间：" + formattedTime);
    }
}
